<?php echo $this->render('index/header.phtml') ?>
<?php $data = $this->paginator;    
    function loadactive($id){
        if($id == 1) return 'Đã duyệt';
        else return 'Chưa duyệt';
    }

    function loadview($id){
        if($id == 1) return 'Đã xem';
        else return 'Chưa xem';
    }

    function loadusername($id){
        Zend_loader::loadClass('Wap_Models_FriendModel');
          $db = new Wap_models_FriendModel();
          $result =  $db->loaduserinfobyid($id);
          if(isset($result[0]['Username'])){
            return $result[0]['Username'];
          }
    }
?>
<!-- content -->
<div id="content-container" class="clearfix">
	<div id="main_content">
		<div id="breadcrumbs">
			<ul>
			    <li><a href="<?php echo DOMAIN; ?>">Trang chủ</a></li>
			    <li class="no_background"><a href="">Theo dõi hồ sơ</a></li>
			</ul>
		</div>

		<h1 class="LearnHeader bigfont"> Theo dõi hồ sơ</h1>
			<!-- noi dung -->
			<div id="containt_client">

				<table style="text-align: center" class="table table-hover table-bordered">
				    <tr>
				        <th style="width:20px">STT</th>
				        <th>Mã số</th>
				        <th>Tên hồ sơ</th>
				        <th>Ngày đăng</th>
				        <th>Xét duyệt</th>
				        <th style="width:20px">Xóa</th>
				        
				    </tr>
				<?php foreach($data as $item){ ?>
				    <tr>
				        <td style="width:20px"><?php echo $item['id'];?></td>
				        <td><?php echo $item['maso'];?></td>
				        <td><a href="/admin/ho-so/edit-page?id=<?php echo $item['id'] ?>"><?php echo $item['namehoso'];?></a></td>

				        <td><?php echo $item['startdate'];?></td>

				        <td><?php echo loadactive($item['active']); ?></td>

				        <td><a href="/admin/ho-so/del-page/?id=<?php echo $item['id'] ;?>"><i  onclick="return confirm('Are you sure?')" class="icon-trash"></i></a></td>        
				    </tr>
				    <!-- nhan xet cua nguoi quan tri -->
				    <?php
					    if($item['nganhangtiepnhan']!=""){
					    ?>
					    	<tr>
					        	<td colspan="6" valgin="middle"> 
					        	<div id="box_hs">
					        		<?php if($item['giatrikhoanvay_ad']!=""): ?>
					        			<p><span class="tit_hs"> Giá trị khoản vay:  </span> <span class="con_hs"> <?php echo $item['giatrikhoanvay_ad'] ;?> </span> </p>
					        		<?php endif;?>
					        		<?php if($item['thoigianvay_ad']!=""): ?>
										<p><span class="tit_hs"> Thời gian vay: </span> <span class="con_hs"><?php echo $item['thoigianvay_ad'] ;?>  </span> </p>
									<?php endif;?>
									<?php if($item['mucdichsudungvon_ad']!=""): ?>
										<p><span class="tit_hs"> Mục đích sử dụng vốn: </span> <span class="con_hs"><?php echo $item['mucdichsudungvon_ad'] ;?>  </span> </p>
									<?php endif;?>
									<?php if($item['nganhangtiepnhan']!=""): ?>
										<p><span class="tit_hs"> Ngân hàng tiếp nhận: </span> <span class="con_hs"><?php echo $item['nganhangtiepnhan'] ;?>  </span> </p>
									<?php endif;?>
									<?php if($item['tinhtranghoso']!=""): ?>
										<p><span class="tit_hs"> Tình trạng hồ sơ:  </span> <span class="con_hs"> <?php echo $item['tinhtranghoso'] ;?> </span> </p>
									<?php endif;?>
									<?php if($item['thoigiangiaingan']!=""): ?>
										<p><span class="tit_hs"> Thời gian giải ngân:  </span> <span class="con_hs"> <?php echo $item['thoigiangiaingan'] ;?> </span> </p>
									<?php endif;?>

								</div><!-- box_hs -->
					        	</td>		               
					    	</tr>
					    <?php
					    } else {					    
					   	?>
					    <tr>
					        <td colspan="6" algin="center" valgin="middle"> Chưa có thông tin </td>				               
					    </tr>
				    <?php } ?>


				<?php } //foreach ?>
				</table>
				

			</div>

		
		<!-- end noi dung-->
		<div class="clear"></div>	
		<!-- page -->
		<?php  echo  $this->paginationControl($this->paginator, 'Sliding', 'account/pagination.phtml',$params=null); ?>
		<!-- end page -->

	</div><!-- main_content -->

	<!-- right bar -->
	<?php echo $this->render('index/home-right.phtml') ?>
	<!-- end right bar -->
</div><!-- content-container -->
<!-- end content -->

<?php echo $this->render('index/footer.phtml') ?>